import { View } from "../../../mvc/core/View";
import { Dispatcher } from "../../../mvc/core/Dispatcher";
import { MailEventName } from "./MailEventName";
import { GCheckBox } from "../../../../com/mui/controls/GCheckBox";
import { Language } from "../../../../extend/language/Language";
import { GButton } from "../../../../com/mui/controls/GButton";
import { TextBox } from "../pack/TextBox";
import { ObjCreate } from "../common/ObjCreate";
import { HTMLUtil } from "../../../../com/gengine/utils/HTMLUtil";
import { DataEvent } from "../../events/DataEvent";
type int = number;
//class MailOperPanel
    
    export  class MailOperPanel extends View
    {
        constructor()
        {
            super();
            this.init();
            Dispatcher.addEventListener(MailEventName.SELALL_CLICK, this.onSelAllClickHandler);
            return;
        }

        public init(): void
        {
            this._checkBox = new GCheckBox();
            this._checkBox.label = Language.getString(52016);
            this._checkBox.name = "SelAllCheckBox";
            this._checkBox.styleName = "GCheckBox";
            this._checkBox.move(13, 8);
            this.addChild(this._checkBox);
            this._delBtn = this.createGButton(68, 6, 45, 23, "DelButton", 52006);
            this._writeBtn = this.createGButton(120, 6, 55, 23, "WriteButton", 52004);
            this._prevPageBtn = new GButton();
            this._prevPageBtn.name = "PrevPageButton";
            this._prevPageBtn.label = "";
            this._prevPageBtn.styleName = "PrevPageButton";
            this._prevPageBtn.setSize(21, 20);
            this._prevPageBtn.move(184, 6);
            this.addChild(this._prevPageBtn);
            this._pageText = new TextBox();
            this._pageText.bgWidth = 52;
            this._pageText.bgHeight = 18;
            this._pageText.htmlText = "";
            this._pageText.x = 206;
            this._pageText.y = 6;
            this.addChild(this._pageText);
            this._nextPageBtn = new GButton();
            this._nextPageBtn.name = "NextPageButton";
            this._nextPageBtn.label = "";
            this._nextPageBtn.styleName = "NextPageButton";
            this._nextPageBtn.setSize(21, 20);
            this._nextPageBtn.move(258, 6);
            this.addChild(this._nextPageBtn);
            return;
        }

        /* internal  */createGButton(arg1: number, arg2: number, arg3: int, arg4: int, arg5: string, arg6: int): GButton
        {
            var loc1=null;
            (loc1 = ObjCreate.createGButton("", arg1, arg2, arg3, arg4, this, "MailBtn")).name = arg5;
            loc1.label = "";
            var loc2=(arg4 - 20) / 2 + 2;
            var loc3;
            (loc3 = ObjCreate.createGTextField("", 0, loc2, arg3, 20, loc1)).textColor = 11727614;
            var loc4;
            (loc4 = loc3.defaultTextFormat).align = flash.text.TextFormatAlign.CENTER;
            loc3.defaultTextFormat = loc4;
            loc3.htmlText = Language.getString(arg6);
            return loc1;
        }

        public updatePage(arg1: int=0, arg2: int=0): void
        {
            this._pageText.htmlText = HTMLUtil.addColor(Language.getStringByParam(52017, arg1, arg2), "#B2F0FF");
            return;
        }

        /* internal  */onSelAllClickHandler(arg1: DataEvent): void
        {
            var loc1=arg1.data as Boolean;
            this._checkBox.selected = loc1;
            return;
        }

        /* internal */ /* var */_windowCenterB: Object /* flash.display.Bitmap */;

        /* internal */ /* var */_checkBox: GCheckBox;

        /* internal */ /* var */_prevPageBtn: GButton;

        /* internal */ /* var */_nextPageBtn: GButton;

        /* internal */ /* var */_pageText: TextBox;

        /* internal */ /* var */_delBtn: GButton;

        /* internal */ /* var */_writeBtn: GButton;
    }
